import request from '@/utils/request'

// 查询学生列表
export function listStudents(query) {
  return request({
    url: '/campus/students/list',
    method: 'get',
    params: query
  })
}

/**
 * 不鉴权
 * @param query
 * @returns {AxiosPromise}
 */
export function queryStudent(query) {
  return request({
    url: '/public/stu/query/list',
    method: 'get',
    params: query
  })
}

export function listStudentsByDeptId(deptId) {
  return request({
    url: '/campus/students/org/' + deptId,
    method: 'get',
  })
}

// 查询学生详细
export function getStudents(studentId) {
  return request({
    url: '/campus/students/' + studentId,
    method: 'get'
  })
}

// 新增学生
export function addStudents(data) {
  return request({
    url: '/campus/students',
    method: 'post',
    data: data
  })
}

// 修改学生
export function updateStudents(data) {
  return request({
    url: '/campus/students/put',
    method: 'post',
    data: data
  })
}

// 删除学生
export function delStudents(studentId) {
  return request({
    url: '/campus/students/' + studentId + '/delete',
    method: 'post'
  })
}
